package com.iwdnb.gkgz.application.kline;

import java.util.List;
import java.util.stream.Collectors;

import com.iwdnb.gkgz.application.service.StockRangeService;
import com.iwdnb.gkgz.common.model.dto.StockDayData;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class LowPriceAndBollingAndBias implements Shape {
    @Autowired
    private StockRangeService stockRangeService;

    @Override
    public List<StockDayData> getMatchData(String code, List<StockDayData> list, List<String> matchDateList) {
        List<String> dateList = stockRangeService.queryBollingAndLowPriceAndBiasDateList(code);
        return list.stream().filter(stockDayData -> dateList.contains(stockDayData.getDate())).collect(
            Collectors.toList());
    }

    @Override
    public boolean match(String code, StockDayData data, List<StockDayData> beforeDatas) {
        return false;
    }
}
